#include<bits/stdc++.h>

using namespace std;

int main() {
    priority_queue<int, vector<int>, greater<int>> q;
    int n;
    cin >> n;
    while (n--) {
        int x;
        cin >> x;
        q.push(x);
        if (q.size() > 10) {
            q.pop();
        }
    }
    stack<int> st;
    while (q.size()) {
        st.push(q.top());
        q.pop();
    }
    while (st.size()) {
        cout << st.top() << " ";
        st.pop();
    }

    return 0;
}